<!--
 * @Descripttion: 性别编辑组件
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-09-09 13:59:30
 * @LastEditors: GW
 * @LastEditTime: 2021-09-16 11:15:17
-->
<template>
    <section class="edit-wrapper">
        <p>标题</p>
        <a-input v-model="data.title" read-only maxLength="16"></a-input>
        <a-divider></a-divider>
        <a-checkbox v-model="data.onFill">是否必选</a-checkbox>
        <!-- <a-divider></a-divider>
        <p>排列方式</p>
        <a-radio-group v-model="data.column" @change="onChange">
            <a-radio :value="1">
                一列
            </a-radio>
            <a-radio :value="2">
                两列
            </a-radio>
        </a-radio-group> -->

    </section>
</template>

<script>
export default {
    name: 'Radio',
    props: {
        data: {
            type: Object,
            default: {}
        }
    },
    methods: {
        addItem () {
            //添加选项
            let data = this.data.data;
            console.log('datadatadata', data)
            if (data) {
                data.forEach((item, index) => {
                    item.key = index + 1;
                });
                let length = data.length;
                let d = { key: length + 1, label: '选项' + (Number(length) + 1) };
                data.push(d);
            }
            this.data.data = data;
        },
        deleteItem (i) {
            //删除选项
            let data = this.data.data;
            data.splice(i, 1);
        },
        changeItem (e, v) {
            console.log(e, v)
        }
    }
}
</script>

<style lang="less" scoped>
    .edit-wrapper {
        padding: 10px 10px 28px;
    }
</style>